// license-header java merge-point
/**
 * This is only generated once! It will never be overwritten.
 * You can (and have to!) safely modify it by hand.
 */
package org.tinaelle.server.domain;
/**
 * @see org.tinaelle.server.domain.AdField
 */
public class AdFieldDaoImpl
    extends org.tinaelle.server.domain.AdFieldDaoBase
{
    /**
     * @see org.tinaelle.server.domain.AdFieldDao#toAdFieldDTO(org.tinaelle.server.domain.AdField)
     */
    public org.tinaelle.common.dto.AdFieldDTO toAdFieldDTO(final org.tinaelle.server.domain.AdField entity)
    {
        return super.toAdFieldDTO(entity);
    }

    /**
     * Retrieves the entity object that is associated with the specified value object
     * from the object store. If no such entity object exists in the object store,
     * a new, blank entity is created
     */
    private org.tinaelle.server.domain.AdField loadAdFieldFromAdFieldDTO(org.tinaelle.common.dto.AdFieldDTO adFieldDTO)
    {
        org.tinaelle.server.domain.AdField adField = this.load(adFieldDTO.getAdFieldId());
        if (adField == null)
        {
            adField = org.tinaelle.server.domain.AdField.Factory.newInstance();
        }
        return adField;
    }

    
    /**
     * @see org.tinaelle.server.domain.AdFieldDao#adFieldDTOToEntity(org.tinaelle.common.dto.AdFieldDTO)
     */
    public org.tinaelle.server.domain.AdField adFieldDTOToEntity(org.tinaelle.common.dto.AdFieldDTO adFieldDTO)
    {
        org.tinaelle.server.domain.AdField entity = this.loadAdFieldFromAdFieldDTO(adFieldDTO);
        this.adFieldDTOToEntity(adFieldDTO, entity, true);
        return entity;
    }
}